package com.hanamaki.iotest;

import java.io.*;
import java.util.Properties;

public class PropertiesTest {

    public static void main(String[] args) {

        Properties properties = new Properties();
        // 设置 properties的属性的值
        properties.setProperty("name", "root");
        properties.setProperty("url", "localhost:3306//");
        properties.setProperty("pwd", "123456");

        System.out.println(properties);

        // 获取 properties属性中的任意一个键的值
        System.out.println(properties.getProperty("url"));


        // 流

        try {
            properties.store(new FileOutputStream("e:/info.txt"), "Test注释");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        char c = '\u6CE8';
        System.out.println(c);
    }
}
